package top.continew.admin.controller.pdnew;

import cn.hutool.core.util.StrUtil;
import cn.shengchao.examstar.rpc.base.PageResult;
import cn.shengchao.examstar.rpc.orders.api.IOrderViewQueryRpc;
import cn.shengchao.examstar.rpc.orders.req.OrderWithSupplierPageQuery;
import cn.shengchao.examstar.rpc.orders.req.OrderWithSupplierView;
import cn.shengchao.examstar.rpc.product.api.IProductUserOrderExpiredRpc;
import cn.shengchao.examstar.rpc.product.base.ContentProductType;
import cn.shengchao.examstar.rpc.product.req.ProductUserOrderExpiredPageQuery;
import cn.shengchao.examstar.rpc.product.res.ProductUserOrderExpiredVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @program: examstar-manger-api
 * @description: 用户订单有效期
 * @author: Xiong weiqiang
 * @create: 2025-06-30 17:54
 */
@Tag(name = "用户购买产品有效期")
@RestController
@RequiredArgsConstructor
@RequestMapping("/userProductExpired")
public class ProductUserOrderExpiredController {
    @DubboReference
    private IProductUserOrderExpiredRpc productUserOrderExpiredRpc;

    @Operation(summary = "用户订单产品有效期分页查询", description = "用户订单产品有效期分页查询")
    @GetMapping("/pageQuery")
    PageResult<ProductUserOrderExpiredVo> pageQueryByUserId(ProductUserOrderExpiredPageQuery pageQuery) {
        if (pageQuery==null){
            pageQuery=new ProductUserOrderExpiredPageQuery();
            pageQuery.setPage(1);
            pageQuery.setSize(10);
        }
        return productUserOrderExpiredRpc.queryUserOrderExpired(pageQuery);
    }
}